package com.laich.springcloud;

import org.jasypt.util.text.BasicTextEncryptor;

//@Data
public class LambdaT {
	public String username;
	public static void main(String[] args) {
		   ReturnOneParam lambda1 = a -> doubleNum(a);
		   System.out.println(lambda1.method(10));
		   LambdaT ts = new LambdaT();

	        //lambda4 引用了已经实现的 addTwo 方法
	        ReturnOneParam lambda4 = ts::addTwo;
	        
	       GetColumnName gn= ts::getUserName;
	        System.out.println(lambda4.method(2));
	        System.out.println(gn.method());
	        BasicTextEncryptor  se2 = new BasicTextEncryptor();
		      //加密所需的salt(盐)//i3cDFhs26sa2Ucrfz2hnQw==
		        se2.setPassword("pig");
		        System.out.println(se2.decrypt("imENTO7M8bLO38LFSIxnzw=="));
		        System.out.println(se2.decrypt("i3cDFhs26sa2Ucrfz2hnQw=="));
	        BasicTextEncryptor  se = new BasicTextEncryptor();
	      //加密所需的salt(盐)//i3cDFhs26sa2Ucrfz2hnQw==
	        se.setPassword("laich");
	        System.out.println("++ "+se.encrypt("laich"));
	       System.out.println(se.decrypt("AzIiJ917DnQqvmbrRDA0Dw=="));
	        System.out.println("++ "+se.encrypt("laich"));
	        System.out.println(se.decrypt("uxF9ZHpGNFUI/0aw+BTrYQ=="));
	        System.out.println("--"+se.encrypt("order"));
	        System.out.println("--"+se.encrypt("order"));
	}

	 /**
     * 要求
     * 1.参数数量和类型要与接口中定义的一致
     * 2.返回值类型要与接口中定义的一致
     */
    public static int doubleNum(int a) {
        return a * 2;
    }

    public int addTwo(int a) {
        return a + 2;
    }
    public String getUserName() {
    	return username;
    }
    
    public void setUserName(String username) {
    	this.username = username;
    }
}


